#include "Stdafx.h"
#include "MainForm.h"
#include <QtGui/QApplication>
#include <QtGui/QPlastiqueStyle>
#include <QtCore/QResource>
#include <QtCore/QTextCodec>
#include <QtCore/QTranslator>

int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	QApplication app(nShowCmd, (char**)"BatchRename");
	QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
	app.setStyle(new QPlastiqueStyle());
	std::string resource = BaseFunction::ModuleDirtory() + "\\Resource\\BatchRename.rcc";
	QResource::registerResource(QString::fromUtf8(BaseFunction::GB2312ToUTF8(resource).c_str()));
	QTranslator translator;
	std::string langzhCN = BaseFunction::ModuleDirtory() + "\\Resource\\qt_zh_CN.qm";
	bool langResult = translator.load(QString::fromUtf8(BaseFunction::GB2312ToUTF8(langzhCN).c_str()));
	if (langResult)
		QApplication::installTranslator(&translator);
	BatchRename::MainForm mainApp;
	mainApp.resize(650, 550);
	mainApp.show();
	return app.exec();
}